As well known, it usually requires extraction of faint target image signal from a complicated image background in image processing. Because of the signal-to-noise ratio of the target image signal is low, filtering pretreatments are performed to effectively reduce the background noise or the random noise to improve the quality of the target image signal. For example, in an ultrasonic imaging system, when measuring the blood flow velocity of a heart, an artery or a vein using the spectral doppler technology, the random noise or the extreme noise may be introduced into the blood flow image. In order to eliminate or reduce such noise, filtering is applied to the image signal, so that the quality of the blood flow image can be improved and the accuracy of the ultrasonic measurement can be enhanced. Different filtering methods like longitudinal filtering, transverse filtering, median filtering, spatial smooth filtering can be taken based on the system complicity and available resources. Among these filtering methods, the median filtering has been extensively applied as it can effectively eliminate the random, spike-like speckle noise.
The median filtering is a non-linear filtering technology, which is commonly used in image processing for removing noises in image signal or other signals. The main idea of the median filtering is to check samples from the input signal, which is performed by a “window” formed by N samples (N is an odd number). The samples in the window are ranked and the middle value (the median) becomes the output. Then, the window removes a first entered sample and introduces a new sample, and repeats the above-mentioned calculation process.
The conventional median filter generally has the following two structures:
The median filter of a first type comprises a data buffer with a length of N signal data and a data register with a length of N signal data. In each clock cycle, N signal data are stored in the data buffer based on the principles of FIFO, while sorted in the data register according to their numerical values. For example, the N signal data are encoded into N decimal values from 0 to N−1 according to their numerical values and the N decimal values are stored in the data register from large to small or small to large, wherein 0 represents the signal datum with the minimum numerical value, N−1 represents the signal datum with the maximum numerical value. In a current clock cycle, when a new signal datum enters the data buffer and a first signal datum entered in a preceding clock cycle leaves the data buffer, the data register re-sorted the latest N signal data and then updates the decimal values stored therein. The median is the numerical value of the signal datum ranked at (N−1)/2+1 in the data register.
The median filter of a second type comprises a data buffer with a length of N signal data and a data register with a length of N signal data. The N signal data are sorted in the data buffer according to their numerical values, while sorted in the data register according to their entry sequence. In a current clock cycle, when a new signal datum enters the data buffer and a first signal datum entered in a preceding clock cycle leaves the data buffer, the latest N signal data are re-sorted according to their numerical values, and the sequence of the latest N signal data is updated.
However, either of the median filters mentioned above is provided with a data buffer and a data register each with a length of N signal data, which requires big data storage capacity, complicated processing ability and large median filtering circuit area, and finally affects the operation efficiency of the median filter.